package com.gzs.learn.springcloud.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.gzs.learn.springcloud.serialize.CustomeDateDeserializer;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class DateEntityDto implements Serializable {
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    private Date defaultDate;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date dateForJackson;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonDeserialize(using = CustomeDateDeserializer.class)
    private Date dateTimeForJackson;
    private LocalDate localDate;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate localDateForJackson;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime localDateTimeForJackson;
}
